Skip to main content

Turn your data into an API

  1. In Workbench create a new UDF that returns data, for example:
@fused.udf
def udf(path: str = "s3://fused-sample/demo_data/housing/housing_2024.csv"):
import pandas as pd
housing = pd.read_csv(path)
housing['price_per_area'] = round(housing['price'] / housing['area'], 2)

return housing[['price', 'price_per_area']]
  1. Click "Share" to open your UDF in a new Tab as a HTML Page
  2. Optionally: Edit the URL to return the data in your preferred file format.

For example changing the format from parquet to json:

# Returning as JSON
https://fused.io/.../run/file?format=json

# Returning as CSV
https://fused.io/.../run/file?format=csv